package com.loyal.loyalerp.humenresource.role.mapper;

import org.apache.ibatis.annotations.Mapper;

@Mapper
public class GyRoleProvider {
	
	public String listRole(String sord) {
		return "select * from gy_role order by id "+sord;
	}
	//SELECT * FROM gy_role WHERE CompanyId NOT LIKE CONCAT(CONCAT('%','17','%'))
	public String findRole(String searchField,String searchString,String searchOper) {
		String search=null;
		if(searchOper.equals("eq")) {
			search="select * from gy_role where "+searchField+" like CONCAT(CONCAT(\'%\',\'"+searchString+"\',\'%\'))";
		}else if(searchOper.equals("ne")){
			search="select * from gy_role where "+searchField+" not like CONCAT(CONCAT(\'%\',\'"+searchString+"\',\'%\'))";
		}
		
		return search;
	}
	public String findCompanyId(String companyname) {
		
		return "select Id from gy_company where CompanyName like CONCAT(CONCAT(\'%\',\'"+companyname+"\',\'%\'))";
	}
	
}
